﻿using System;
using System.Data;

using DAL;
using Model;

namespace BLL
{
    public class TesterInfoBLL
    {
        public TesterInfoBLL()
        {
        }

        public DataSet GetListByGuid(string strWhere)
        {
            return TesterInfoDAL.GetListByGuid(strWhere);
        }

        public DataSet GetListByEnterprise(string eid, string activityID)
        {
            return TesterInfoDAL.GetListByEnterprise(eid, activityID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(TesterInfo model)
        {
            //TODO: ADD  return EnterpriseUserDAL.Add(model);
            return TesterInfoDAL.Add(model);
        }

        public string GetUserNameByGUID(string strWhere)
        {
            return TesterInfoDAL.GetUserNameByGUID(strWhere);
        }

        public string GetPositionByGUID(string strWhere)
        {
            int activityId = GuidNoDAL.GetActivityId(strWhere);
            int positionId = ActivityDAL.GetPositionId(activityId);
            return PositionDAL.GetPositionNmById(positionId);
        }

        //public DataSet GetEnter
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(TesterInfo model)
        {
            TesterInfoDAL.Update(model);
        }

        public int UpdateTesterInfo(string testersn, string updatefieldName, string updatefieldValue)
        {
            return TesterInfoDAL.UpdateTesterInfo(testersn, updatefieldName, updatefieldValue);
        }
    }
}
